home *** CD-ROM | disk | FTP | other *** search
- /* headers for the mergeIndices project ... 871203-... ^z
- * revised 871230 for XFCN work ... ^z
- */
-
-
- #include <MacTypes.h>
- #include <OSUtil.h>
- #include <WindowMgr.h>
- #include <FileMgr.h>
- #include <StdFilePkg.h>
- #include <HyperXCmd.h>
-
- /* define euphemisms so that array subscripts are human-readable...
- */
- #define FIRSTIN 0
- #define SECONDIN 1
- #define MERGEDOUT 2
- #define PTRFILE 0
- #define KEYFILE 1
- #define TEXTFILE 2
-
- #define NULL 0
-
- /* define these to allow use of global variables in my XFCN
- */
-
- #define SetUpA4() asm { move.l a4,-(sp) \
- move.l a0,a4 }
-
- #define RestoreA4() asm { move.l (sp)+,a4 }
-
-
-
-
- /* sort on KEY_LENGTH characters ... make it 28 rather arbitrarily as an
- * experiment ... want it long enough to avoid truncation of legitimate
- * words, but short enough to save some space in the *.k files ... an
- * alternative value is 12, for compatibility with the older ndxr.c program
- * and brwsr.c, if they haven't been revised to allow for longer keys....
- */
- #define KEY_LENGTH 28
-
- /* define a structure for the index_keys file
- */
- typedef struct
- {
- char kkey[KEY_LENGTH];
- long ccount;
- } KEY_REC;
-
-
- /* prototypes for my functions ...
- */
-
- pascal void main (XCmdBlockPtr paramPtr);
- void give_msg (char *msg);
- void beepWait (void);
- long atol (char *num);
- int init_everything (XCmdBlockPtr paramPtr);
- int open_all_files (void);
- int merge_key_and_ptr_files (void);
- int delete_old_key_and_ptr_files (void);
- int merge_text_files (void);
- int delete_and_rename_text_files (void);
- int getTextFile (int filenum);
- int putTextFile (void);
- int getFileZ (Str255 *fnp, int *vRefp);
- void pStrCopy (char *p1, char *p2);
- int CreateFile (Str255 *fn, int *vRef, int *theRef);
- KEY_REC *next_input_key (int filenum);
- void load_buffer (int filenum, int filetype);
- int smaller_key (KEY_REC *kr[]);
- char *strncpy (char *p1, char *p2, int len);
- int merge_not_done (KEY_REC *kr[]);
- int zstrcmp (unsigned char *s1, unsigned char *s2);
- void output_key_rec (char *kkey, long ccount);
- void output_ptr_recs (int filenum, long num);
- long *next_input_ptr (int filenum);
- void flush_outbuffer (int filetype);